Telegram Group & Telegram Channel
Can't step through code in VS Code + OpenOCD + GDB with RISC-V — everything connects but stepping doesn't work


Hi! I'm setting up debugging for a RISC-V project in VS Code using the Cortex-Debug extension. I'm using OpenOCD and `riscv32-unknown-elf-gdb`. The configuration seems to launch correctly: OpenOCD starts, GDB connects, and the ELF file (`main.elf`) is loaded. A breakpoint in `main()` also sets successfully.

But then I run into problems:

* After `exec-continue`, the program stops at `0x00010058 in ?? ()`.
* The breakpoint in `main()` doesn’t hit, and I can’t step through the code (step over / step into doesn’t work).
* `main()` is at `0x400000c0`, and the ELF is built with `-g`, but something is clearly off.

# What I’ve checked:

* `"showDevDebugOutput": "parsed"` is set
* The ELF file contains debug symbols (verified with `nm`, `objdump`)
* Using custom `riscv.cfg` and my own `startup.S`
* Using `riscv32-unknown-elf-gdb` and OpenOCD listening on `localhost:50000`
* `readelf` shows the entry point does **not** match the address of `main()`

launch.json

{
"configurations": [
{
"name": "RISCV",
"type": "cortex-debug",
"request": "launch",
// "showDevDebugOutput": "parsed",
"servertype": "openocd",
"cwd": "${workspaceFolder}",
"executable": "./build/main.elf",
"gdbTarget": "localhost:50000",
"configFiles": [
"lib/riscv.cfg"
],
"postLaunchCommands": [
"load"
],
"runToEntryPoint": "main"
}
]
}

settings.json

{
"cortex-debug.openocdPath": "/usr/bin/openocd",
"cortex-debug.variableUseNaturalFormat": true,
"cortex-debug.gdbPath": "/home/riscv/bin/riscv32-unknown-elf-gdb",
"search.exclude": {
"**/build": true
},
"files.associations": {
"printf_uart.h": "c"
}
}

https://redd.it/1kr1rao
@r_riscv



tg-me.com/r_riscv/3338
Create:
Last Update:

Can't step through code in VS Code + OpenOCD + GDB with RISC-V — everything connects but stepping doesn't work


Hi! I'm setting up debugging for a RISC-V project in VS Code using the Cortex-Debug extension. I'm using OpenOCD and `riscv32-unknown-elf-gdb`. The configuration seems to launch correctly: OpenOCD starts, GDB connects, and the ELF file (`main.elf`) is loaded. A breakpoint in `main()` also sets successfully.

But then I run into problems:

* After `exec-continue`, the program stops at `0x00010058 in ?? ()`.
* The breakpoint in `main()` doesn’t hit, and I can’t step through the code (step over / step into doesn’t work).
* `main()` is at `0x400000c0`, and the ELF is built with `-g`, but something is clearly off.

# What I’ve checked:

* `"showDevDebugOutput": "parsed"` is set
* The ELF file contains debug symbols (verified with `nm`, `objdump`)
* Using custom `riscv.cfg` and my own `startup.S`
* Using `riscv32-unknown-elf-gdb` and OpenOCD listening on `localhost:50000`
* `readelf` shows the entry point does **not** match the address of `main()`

launch.json

{
"configurations": [
{
"name": "RISCV",
"type": "cortex-debug",
"request": "launch",
// "showDevDebugOutput": "parsed",
"servertype": "openocd",
"cwd": "${workspaceFolder}",
"executable": "./build/main.elf",
"gdbTarget": "localhost:50000",
"configFiles": [
"lib/riscv.cfg"
],
"postLaunchCommands": [
"load"
],
"runToEntryPoint": "main"
}
]
}

settings.json

{
"cortex-debug.openocdPath": "/usr/bin/openocd",
"cortex-debug.variableUseNaturalFormat": true,
"cortex-debug.gdbPath": "/home/riscv/bin/riscv32-unknown-elf-gdb",
"search.exclude": {
"**/build": true
},
"files.associations": {
"printf_uart.h": "c"
}
}

https://redd.it/1kr1rao
@r_riscv

BY RISC-V Reddit




Share with your friend now:
tg-me.com/r_riscv/3338

View MORE
Open in Telegram


RISC V Reddit Telegram | DID YOU KNOW?

Date: |

Telegram and Signal Havens for Right-Wing Extremists

Since the violent storming of Capitol Hill and subsequent ban of former U.S. President Donald Trump from Facebook and Twitter, the removal of Parler from Amazon’s servers, and the de-platforming of incendiary right-wing content, messaging services Telegram and Signal have seen a deluge of new users. In January alone, Telegram reported 90 million new accounts. Its founder, Pavel Durov, described this as “the largest digital migration in human history.” Signal reportedly doubled its user base to 40 million people and became the most downloaded app in 70 countries. The two services rely on encryption to protect the privacy of user communication, which has made them popular with protesters seeking to conceal their identities against repressive governments in places like Belarus, Hong Kong, and Iran. But the same encryption technology has also made them a favored communication tool for criminals and terrorist groups, including al Qaeda and the Islamic State.

What is Telegram?

Telegram is a cloud-based instant messaging service that has been making rounds as a popular option for those who wish to keep their messages secure. Telegram boasts a collection of different features, but it’s best known for its ability to secure messages and media by encrypting them during transit; this prevents third-parties from snooping on messages easily. Let’s take a look at what Telegram can do and why you might want to use it.

RISC V Reddit from hk


Telegram RISC-V Reddit
FROM USA